home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / patches / spmaso12.lha / SetPatchMC702.asm < prev    next >
Assembly Source File  |  1995-10-12  |  3KB  |  124 lines

  1. START     move.l    $4.w,a6
  2.           moveq     #37,d0
  3.           lea       dosname(pc),a1
  4.           jsr       _LVOOpenLibrary(a6)
  5.           move.l    d0,_DosBase
  6.           beq.s     .exit
  7.           move.l    d0,a6
  8.           lea       template(pc),a0
  9.           move.l    a0,d1
  10.           lea       _Param(pc),a0
  11.           move.l    a0,d2
  12.           moveq     #0,d3
  13.           jsr       _LVOReadArgs(a6)
  14.           move.l    d0,d1
  15.           bne.s     .ArgsOK
  16.           jsr       _LVOIoErr(a6)
  17.           move.l    d0,d1
  18.           move.l    d3,d2
  19.           jsr       _LVOPrintFault(a6)
  20. .quit     move.l    $4.w,a6
  21.           move.l    _DosBase(pc),a1
  22.           jsr       _LVOCloseLibrary(a6)
  23. .exit     moveq     #0,d0
  24.           rts
  25.  
  26.           cnop      0,4
  27.  
  28. .error    lea       errortxt(pc),a0
  29.           move.l    a0,d1
  30.           move.l    _DosBase(pc),a6
  31.           jsr       _LVOPutStr(a6)
  32.           bra       .quit
  33.  
  34.           cnop      0,4
  35.  
  36. .ArgsOK   move.l    _Param(pc),d0
  37.           beq.s     .skip0
  38.           move.l    d0,a0
  39.           move.l    (a0),_Mask
  40. .skip0    jsr       _LVOFreeArgs(a6)
  41.           move.l    $4.w,a6
  42.           lea       DeviceList(a6),a0
  43.           lea       mcname(pc),a1
  44.           jsr       _LVOFindName(a6)
  45.           move.l    d0,_Device
  46.           beq       .error
  47.           move.l    d0,a0
  48.           cmpi.w    #2,LIB_VERSION(a0)
  49.           bne       .error
  50.           cmpi.w    #202,LIB_REVISION(a0)
  51.           bne.s     .error
  52.           lea       mcname(pc),a1
  53.           jsr       _LVOFindTask(a6)
  54.           move.l    d0,_Task
  55.           beq.s     .error
  56.           jsr       _LVODisable(a6)
  57.           moveq     #0,d7
  58.           move.l    _Device(pc),a0
  59.           move.l    -4(a0),a0
  60.           lea       $34(a0),a0
  61.           cmpi.l    #$302e0186,(a0)
  62.           bne.s     .skip1
  63.           cmpi.l    #$03006708,4(a0)
  64.           bne.s     .skip1
  65.           moveq     #1,d7
  66.           lea       Patch1,a1
  67.           move.w    #$4eb9,(a0)+
  68.           move.l    a1,(a0)
  69. .skip1    move.l    _Task(pc),a0
  70.           move.l    pr_SegList(a0),d0
  71.           beq.s     .skip2
  72.           lsl.l     #2,d0
  73.           move.l    d0,a0
  74.           move.l    $c(a0),d0
  75.           beq.s     .skip2
  76.           lsl.l     #2,d0
  77.           move.l    d0,a0
  78.           lea       $2e0(a0),a0
  79.           cmpi.l    #$226a001c,(a0)
  80.           bne.s     .skip2
  81.           moveq     #1,d7
  82.           lea       Patch2,a1
  83.           move.w    #$4eb9,(a0)+
  84.           move.l    a1,(a0)+
  85.           move.w    #$6f3c,(a0)
  86. .skip2    tst.l     d7
  87.           beq.s     .skip3
  88.           lea       START-4(pc),a0
  89.           clr.l     (a0)
  90. .skip3    jsr       _LVOCacheClearU(a6)
  91.           jsr       _LVOEnable(a6)
  92.           bra       .quit
  93.  
  94.  
  95. dosname   dc.b      "dos.library",0
  96. mcname    dc.b      "MASOBOSHI.device",0
  97.           dc.b      "$VER: SetPatchMC702 1.2 (12.10.95)"
  98.           dc.b      "for MASOBOSHI.device v2.202",0
  99. errortxt  dc.b      "You need MASOBOSHI.device v2.202 to install this patch!",10,0
  100. template  dc.b      "UNITMASK/N",0
  101.           even
  102. _Device   dc.l      0
  103. _Task     dc.l      0
  104. _DosBase  dc.l      0
  105. _Param    dc.l      0
  106.  
  107.           section   Ooops,CODE
  108.  
  109. _Mask     dc.l      0
  110.  
  111. Patch1    move.w    $186(a6),d0
  112.           or.w      _Mask+2(pc),d0
  113.           btst      d1,d0
  114.           rts
  115.  
  116.           cnop      0,4
  117.  
  118. Patch2    move.l    $1c(a2),d1
  119.           move.l    d1,a1
  120.           add.l     a1,a1
  121.           add.l     a1,a1
  122.           subq.l    #2,d1
  123.           rts
  124.